import request from '@/utils/request'


export function getDiscountList (data,method) { //列表
    return request({
        url: '/coupon-center/coupon',
        method: method,
        params:data
    })
}

export function getOneDiscount (data) { //列表
    return request({
        url: '/coupon-center/coupon/'+data,
        method: 'get',
       
      })
}

export function createDiscount (data,method) { //创建优惠券
    return request({
      url: '/coupon-center/coupon',
      method: method,
      data
    })
}

export function getClassify (data) { //寄卖所有分类 
    return request({
      url: '/goods/goods/category/list',
      method: 'get',
      params:data
    })
}

export function getbrandList (data) { //寄卖所有品牌 
    return request({
      url: '/goods/goods/brand/page',
      method: 'POST',
      data
     
    })
}


export function delDiscount (data) { //删除优惠券
    return request({
      url: '/coupon-center/coupon/'+data,
      method: "DELETE",
     
    })
}

export function allChannel () {//获取主渠道子渠道
    return request({
      url :'/communal/communal-channel/all',
      method: 'get',
    })
  }